package com.czr.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;
import java.util.Optional;

/**
 * Description:
 * Author: czr czr
 * Version: 1.0
 * Create Date Time: 2021/11/17 15:59.
 * Update Date Time:
 *
 * @see
 */
@Controller
@Slf4j
public class IndexController {

    @GetMapping("/blog")
    public String index(Model model, String cid, HttpSession session){
        log.info("2222 ---> 执行了index");

        model.addAttribute("cid", Optional.ofNullable(cid).orElse("0"));

        return "index";
    }


}
